const path = require('path')
const rules = require('./webpack.rules');

const copyWebpackPlugin = require('copy-webpack-plugin');


module.exports = {
    /**
     * This is the main entry point for your application, it's the first file
     * that runs in the main process.
     */
    entry: './src/main/main.js',
    // Put your normal webpack config below here
    module: {
        rules,
    },
    plugins: [
        new copyWebpackPlugin({
            patterns: [{
                from: path.resolve(__dirname, 'src', 'main', 'static'),
                to: path.resolve(__dirname, '.webpack', 'main', 'static')
            }],
        }),
    ],
    devServer: {
        port: 9000,
        proxy: {
            '': {
                target: 'http://localhost:8080/',
                changeOrigin: true,
                secure: false,
                pathRewrite: {
                    '^' : ''
                },
            }
        }
    }
};
